package cn.edu.scau.cmi.xuminbang.client.spring;

import org.springframework.context.ApplicationContext;

import cn.edu.scau.cmi.xuminbang.spring.domain.IocStudent;
import cn.edu.scau.cmi.xuminbang.spring.domain.IocTeacher;
import cn.edu.scau.cmi.xuminbang.util.ApplicationContextUtil;

public class Spring03SingletonApplicationContextClient {


	public Spring03SingletonApplicationContextClient() {
	}

	public static void main(String[] args) {
		ApplicationContext ac = getApplicationContext();
		IocStudent zhangsan=(IocStudent) ac.getBean("zhangsan");
		System.out.println(zhangsan.getName()+"的毕业设计指导导师是："+zhangsan.getTutor().getName());
	}


	public static ApplicationContext getApplicationContext() {
		ApplicationContext applicationContext=ApplicationContextUtil.getApplicationContext();
		return applicationContext;
	}

}
